/*
	设年龄为o, 出生月份为m,则
	(2*m+5)*50+o-365=n
	100m+250+o-365=n
	100m+o=n+365-250
	o= (n+365-250)%100
	m=(n+365-250)/100
*/

#include<stdio.h>

int main(void)
{
	int n;
	scanf("%d",&n);
	printf("%d %d\n", (n+365-250)%100, (n+365-250)/100);
	return 0;
}
